//
//  MainTableViewCell.m
//  2018.04.03-MasonryExercise
//
//  Created by lsp's mac pro on 2018/4/3.
//  Copyright © 2018年 lsp's mac pro. All rights reserved.
//

#import "MainTableViewCell.h"
@interface MainTableViewCell()
@property(nonatomic,strong)UIView*headView;
@property(nonatomic,strong)UILabel*lbName;
@property(nonatomic,strong)UILabel*lbDes;
@property(nonatomic,strong)UIImageView*imageSex;
@end
@implementation MainTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupUI];
      
    }
    return self;
}
-(void)setupUI{
    _headView=[[UIView alloc]init];
    _headView.backgroundColor=[UIColor redColor];
    [self.contentView addSubview:_headView];
    [_headView makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(AdaptedWidth(50));
        make.width.mas_equalTo(AdaptedWidth(50));
        make.top.left.mas_equalTo(self.contentView).offset(AdaptedWidth(15));
        
    }];
    _lbName=[[UILabel alloc]init];
    _lbName.backgroundColor=[UIColor blueColor];
    [self.contentView addSubview:_lbName];
    
    [_lbName makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(AdaptedWidth(20));
        make.top.mas_equalTo(self.contentView).offset(AdaptedWidth(15));
        make.right.mas_equalTo(self.contentView).offset(AdaptedWidth(-10));
        make.left.mas_equalTo(_headView.right).offset(AdaptedWidth(10));
        
    }];
    
    _lbDes=[[UILabel alloc]init];
    _lbDes.backgroundColor=[UIColor greenColor];
    [self.contentView addSubview:_lbDes];
    [_lbDes makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_headView.right).offset(AdaptedWidth(10));
        make.right.mas_equalTo(self.contentView).offset(AdaptedWidth(-10));
        make.top.mas_equalTo(_lbName.bottom).offset(AdaptedWidth(5));
        make.height.mas_equalTo(AdaptedWidth(40));
    }];
    
    _imageSex=[[UIImageView alloc]init];
    _imageSex.backgroundColor=[UIColor darkGrayColor];
    [self.contentView addSubview:_imageSex];
    [_imageSex makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(AdaptedWidth(10));
        make.width.mas_equalTo(AdaptedWidth(10));
        make.left.mas_equalTo(_headView.left).offset(AdaptedWidth(40));
        make.top.mas_equalTo(_headView.top).offset(AdaptedWidth(40));
    }];
    

    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    
}

@end
